<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>新瑞途-查询账号</title>
    <meta name="Generator" content="vsCode">
    <meta name="Author" content="x">
    <meta name="Keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge chrome=1">
    <!--IE8浏览器的显示方式：IE=edge以IE最高版本显示 Chrome=1以谷歌浏览器模式渲染-->
    <meta name="referrer" content="never">
    <!--告诉浏览器链接的来源（可以计算链接的访问量）-->
    <meta name="format-detection" content="telephone=no,email=no,address=no">
    <!--格式检测（数字，邮箱，地址）no 不识别为电话号码，邮箱，地址-->
    <meta name="renderer" content="webkit">
    <meta name="Description" content="">

    <style type="text/css">
        *{
            margin: 0;
            padding: 0;
        }
        ul,li{
            list-style:none;
        }
        a{
            text-decoration:none;
        }
        input{
            outline-style:none;
            border: 0px;
        }
        #form1{

            margin-top:20px;
            width:80%;
            margin:2px auto;
        }
        #form1 form span{
            color:#999;
        }
        .row {
            margin-top: 25px;
            height: 50px;
            line-height: 26px;
            border-bottom: 1px solid #c7c6c6;
            width:100%;
        }
        .input {
            position: relative;
            width: 100%;
            height: 26px;
        }
        .input input {
            display: block;
            width: 100%;
            height: 26px;
            border:none;
            background: none;
            outline:none;
        }
        .input label {
            position: absolute;
            top:0;
            left:0;
            height: 26px;
            line-height: 26px;
            font-size: 14px;
            color: #999;
        }
        .select select{
            display:block;
            width:100%;
            border:none;
            outline:none;
        }
        input[type=date]::-webkit-inner-spin-button { visibility: hidden; }
        .button{
            width:100%;
            height:40px;
            background: #2d9cb5;
            outline: none;
            margin:20px 0 30px 0;
        }
        .button button{
            border:0px;
            background-color:transparent;
            color:white;
            width: 100%;
            height:40px;
            margin:0 auto;
            font-size:17px;
        }

    </style>
</head>

<body>
<div id="form1">
    <form action="" method="post">
        <br>
        <div class="row ">
            <div class="input">
                <span>姓名</span><br>
                <input type="text" id="realName" name="realName" placeholder="请输入真实姓名"/><br>
            </div>
        </div>
        <div class="row">
            <div class="input">
                <span>手机</span><br>
                <input id="phone" type="text" name="phone" placeholder="请输入手机号码"/><br>
                <i class="Phone"><b></b></i>
            </div>
        </div>
        <div class="button">
            <button type="button" onclick="checkNo();">查询账号</button>
        </div>
    </form>
</div>
<script src="/static/bower_components/jquery/dist/jquery.min.js"></script>
<script type="text/javascript">


    function checkForm(realName,phone){

        if(!/^[\u4e00-\u9fa5]{2,30}$/.test(realName)){
            alert("请输入正确的姓名");
            return false;
        }
        if(!/^1[34578][0-9]\d{8}$/.test(phone)){
            alert("请输入正确的手机号");
            return false;
        }
        return true;
    }

    function checkNo() {
        var realName = $("#realName").val();
        var phone = $("#phone").val();
        if(checkForm(realName,phone)){

            $.ajax({
                url:"/wx/checkNo",
                type:"get",
                dataType:"json",
                cache:false,
                data:{
                    realName:realName,
                    phone:phone
                },
                success:function(data){
                    if(data.status == 'success'){
                        var empData = data.data;
                        if(empData != null && empData != ""){
                            alert("您的账号是：\n    " +  empData.username);
                            location.href = "/static/wxpage/wxLogin.html";
                        }else{
                            alert("姓名和电话不批匹配");
                        }
                    }else{
                        alert(data.msg);
                    }
                }
            });
        }
    }

</script>
</body>
</html>
